package com.pinapel.aixml.controller;


import com.pinapel.aixml.models.Model;
import com.pinapel.aixml.ui.ArbolesUI;


public class ArbolesController implements IArbolesController {
	
	private IMainController mMainController;
	
	private ITreeController XmlTreeController;
    private ITreeController XsdTreeController;
    
    private ArbolesUI mView;
	
    public ArbolesController(IMainController topController){
    	this.mMainController=topController;
    	this.XmlTreeController=new TreeController(this);
    	this.XsdTreeController=new TreeController(this);
    }
	public IMainController getMainController() {
		// TODO Auto-generated method stub
		return null;
	}

	
	public Model getModel() {
//		// TODO Auto-generated method stub
		return mMainController.getModel();
	}

	
	public void setView(ArbolesUI mView) {
		// TODO Auto-generated method stub
		this.mView = mView;
		this.mView.setController(this);
		this.assingViewsToControllers();
	}
	
	private void assingViewsToControllers(){
		XmlTreeController.setView(mView.getXmlTree());
		XsdTreeController.setView(mView.getXsdTree());
		
		
	}


	
	public ITreeController getXMLTreeController() {
		// TODO Auto-generated method stub
		return XmlTreeController;
	}

	@Override
	public ITreeController getXSDTreeController() {
		// TODO Auto-generated method stub
		return XsdTreeController;
	}

	

}
